package com.ssyt.yt1.day20.annotation;

import java.lang.reflect.Method;

/**
 * 3、读取注解
 * 
 * @author Administrator
 *
 */
public class ReadAnnotation {

	public static void main(String[] args) throws ClassNotFoundException,
			NoSuchMethodException, SecurityException {
		Class<?> myAnnotationUse = Class
				.forName("com.ssyt.yt1.day20.annotation.UseAnnotation");
		Method method = myAnnotationUse.getMethod("test");
		if (method.isAnnotationPresent(DefinedAnnotation.class)) {
			DefinedAnnotation myAnnotation = method
					.getAnnotation(DefinedAnnotation.class);
			System.out.println(myAnnotation.value());
			System.out.println(myAnnotation.param());
		}

	}
}
